//
//  HBPopView.h
//  HBActionSheet
//
//  Created by 韩冰 on 2017/10/23.
//  Copyright © 2017年 韩冰. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, HBPopViewType) {
    HBPopViewTypeAlert,
    HBPopViewTypeSheet,
    HBPopViewTypeCustom,
};
@class HBPopView;
typedef void(^HBPopupBlock)(HBPopView *);
typedef void(^HBPopupCompletionBlock)(HBPopView *, BOOL);

@interface HBPopView : UIView

@property (nonatomic, assign, readonly) BOOL           visible;             // default is NO.

@property (nonatomic, assign)   HBPopViewType    type;                // default is MMPopupTypeAlert.
@property (nonatomic, assign)   NSTimeInterval animationDuration;   // default is 0.3 sec.
@property (nonatomic, strong)   UIView         *attachedView;
@property (nonatomic, copy)     HBPopupCompletionBlock   showCompletionBlock; // show completion block.
@property (nonatomic, copy)     HBPopupCompletionBlock   hideCompletionBlock; // hide completion block

@property (nonatomic, copy)     HBPopupBlock   showAnimation;       // custom show animation block.
@property (nonatomic, copy)     HBPopupBlock   hideAnimation;       // custom hide animation block.

@property (nonatomic, assign)   BOOL touchBgWildToHide;//点击背景是否消失 默认Yes
/**
 *  show the popup view
 */
- (void) show;

/**
 *  show the popup view with completiom block
 *
 *  @param block show completion block
 */
- (void) showWithBlock:(HBPopupCompletionBlock)block;

/**
 *  hide the popup view
 */
- (void) hide;

/**
 *  hide the popup view with completiom block
 *
 *  @param block hide completion block
 */
- (void) hideWithBlock:(HBPopupCompletionBlock)block;

@end
